package eu.flexblog.core.controller
{
 /**
 * Startup command 
 * 
 * @author  Mike Bevz <myb@mikebevz.com>
 * @version $Id$
 * 
 */	
	import eu.flexblog.core.ApplicationFacade;
	import eu.flexblog.core.model.ModuleRegistryProxy;
	import eu.flexblog.core.view.ContentShellMediator;
	import eu.flexblog.core.view.MenuBarMediator;
	
	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	
	public class StartupCmd extends SimpleCommand implements ICommand
	{
		/**
		 * Execute method. Application initialization
		 * @param note Notification object
		 * 
		 */		
		override public function execute(note:INotification):void
		{
			var app:flexblog = note.getBody() as flexblog;
			
			facade.registerMediator(new MenuBarMediator(app.menuBar));
			facade.registerMediator(new ContentShellMediator(app.contentShell));
			facade.registerProxy(new ModuleRegistryProxy());
				
			sendNotification(ApplicationFacade.LOAD_MODULES);
		}
	}
}